package com.camel.core.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.camel.core.entity.BasePaginationEntity;
import com.camel.core.enums.EntityStatus;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author baily
 * @since 2019/7/4
 **/
@Data
public class SysRoleMenu extends BasePaginationEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 角色ID
     */
    private Integer roleId;
    /**
     * 菜单ID
     */
    private Integer menuId;

    @TableField(exist = false)
    private String menuIds;

    public SysRoleMenu() {
    }

    public SysRoleMenu(Integer roleId, Integer menuId) {
        this.roleId = roleId;
        this.menuId = menuId;
    }

    public SysRoleMenu(Integer id, Integer roleId, Integer menuId, Integer status, Date gmtCreate, Date gmtModified) {
        this.id = id;
        this.roleId = roleId;
        this.menuId = menuId;
        this.status = EntityStatus.NORMAL;
    }

    @Override
    public String toString() {
        return "SysRoleMenu{" +
                ", id=" + id +
                ", roleId=" + roleId +
                ", menuId=" + menuId +
                ", status=" + status +
                "}";
    }
}
